/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;

import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "LEADER_WORKSTATE")
public class LeaderWorkstate extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "领导工作状态";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_LDMC = "领导姓名";
	public static final String ALIAS_ZT = "工作状态";
	public static final String ALIAS_BZ = "备注";
	public static final String ALIAS_RQ = "日期";
	
	//date formats
	public static final String FORMAT_RQ = DATE_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	
	private Long id;
    /**
     * 领导姓名       db_column: LDMC 
     */ 	
	@Length(max=30)
	private java.lang.String ldmc;
    /**
     * 工作状态       db_column: ZT 
     */ 	
	@Length(max=30)
	private java.lang.String zt;
    /**
     * 备注       db_column: BZ 
     */ 	
	@Length(max=400)
	private java.lang.String bz;
    /**
     * 日期       db_column: RQ 
     */ 	
	
	private java.util.Date rq;
	@Max(32767)
	private Integer sortno;
	//columns END


	public LeaderWorkstate(){
	}

	public LeaderWorkstate(
		Long id
	){
		this.id = id;
	}

	

	public void setId(Long value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getId() {
		return this.id;
	}
	
	@Column(name = "LDMC", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getLdmc() {
		return this.ldmc;
	}
	
	public void setLdmc(java.lang.String value) {
		this.ldmc = value;
	}
	
	@Column(name = "ZT", unique = false, nullable = true, insertable = true, updatable = true, length = 30)
	public java.lang.String getZt() {
		return this.zt;
	}
	
	public void setZt(java.lang.String value) {
		this.zt = value;
	}
	
	@Column(name = "BZ", unique = false, nullable = true, insertable = true, updatable = true, length = 400)
	public java.lang.String getBz() {
		return this.bz;
	}
	
	public void setBz(java.lang.String value) {
		this.bz = value;
	}
	
	@Transient
	public String getRqString() {
		return DateConvertUtils.format(getRq(), FORMAT_RQ);
	}
	public void setRqString(String value) {
		setRq(DateConvertUtils.parse(value, FORMAT_RQ,java.util.Date.class));
	}
	
	@Column(name = "RQ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getRq() {
		return this.rq;
	}
	
	public void setRq(java.util.Date value) {
		this.rq = value;
	}
	
	@Column(name = "SORTNO", unique = false, nullable = true, insertable = true, updatable = true, length = 5)
	public Integer getSortno() {
		return this.sortno;
	}
	
	public void setSortno(Integer value) {
		this.sortno = value;
	}
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Ldmc",getLdmc())
			.append("Zt",getZt())
			.append("Bz",getBz())
			.append("Rq",getRq())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof LeaderWorkstate == false) return false;
		if(this == obj) return true;
		LeaderWorkstate other = (LeaderWorkstate)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

